import request from "../utils/request"

/**
 * 
 *  获取附近店铺
 */
export function nearShop() {
    return request.get('/nearbymerchant/nearshop')
}
/**
 * 店铺详情
 */

export function detailed(params) {
    return request.get('/nearbymerchant/detailed', {
        params
    })
}


/**
 * 登录
 */
export function login(params) {
    return request.get('/user/login', {
        params
    })
}


/**
 * 注册
 */
export function regist(data) {
    return request.post('/user/regist', data)
}


/**
 * 商城分类
 */
export function Shop(params) {
    return request.get('/shop/fenlei', params)
}


/**
 * 添加宠物
 */
export function insertpet(data) {
    // console.log(data, "dadadadad")
    return request.post('/pet/insertpet', data)
}


/**
 * 删除宠物
 */
export function deletepet(params) {
    // console.log(data,"dadadadad")
    return request.get(`/pet/deletepet?petid=${params}`)
}


/**
 * 获取宠物信息
 */
export function selectpet(params) {
    //  let id = 9
    return request.get(`/pet/selectpet?userid=${params}`)
}
/* /shop/tuijian
 * 推荐商品
 */
export function shopTuijian() {
    return request.get('/shop/tuijian')

}
/**
 * /shopdetail/detail
 * 商品详情
 */

export function shopdetail(id) {
    return request.get('/shopdetail/detail?id=' + id)

}


/**
 * 所有商品
 */
export function shopAll() {
    return request.get('/shop/selectAllShop')
}

export function img(data) {
    return request.post('/user/picture', data)
}


/**
 * 分类对应数据
 */
export function shopcall(fname) {
    return request.get('/shop/selectByName?fname=' + fname)
}




/**
 * 修改用户
 */

export function updateuser(data) {
    // console.log(data, "sssssss")
    return request.post('/user/updateuser', data)
}
/**
 * 加入购物车
 */

export function AddShop(data) {
    return request.post('/shoppingcart/insert', data)
}

/**
 * 购物车列表
 */

export function ShopCartList(usersid) {
    return request.get('/shoppingcart/selectByUsersid?usersid=' + usersid)
}


/**
 * 删除购物车商品
 */

export function ShopCartDel(id) {
    return request.get('/shoppingcart/delete?id=' + id)
}

/**
 * 购物车+1
 */
export function CountJia(id) {
    return request.get('/shoppingcart/insertcount?id=' + id)
}


/**
 * 购物车-1
 */
export function CountJian(id) {
    return request.get('/shoppingcart/deletecount?id=' + id)
}



/**
 * 添加订单
 */
export function AddOrders(order) {
    return request.post('/order/insertorders', order)
}